package com.shop.shoppingmall.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.shop.shoppingmall.entity.ShProductSpecs;
import com.shop.shoppingmall.entity.ShUser;
import com.shop.shoppingmall.service.ShProductSpecsService;
import com.shop.shoppingmall.util.api.vo.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (ShProductSpecs)表控制层
 *
 * @author makejava
 * @since 2020-09-07 17:09:48
 */
@RestController
@RequestMapping("shProductSpecs")
@CrossOrigin
public class ShProductSpecsController {
    /**
     * 服务对象
     */
    @Resource
    private ShProductSpecsService shProductSpecsService;
    /**
     * 修改库存及价格
     * @param jsonObject
     * @return
     */
    @PostMapping("update")
    public Result update(@RequestBody JSONObject jsonObject) {
        ShProductSpecs shProductSpecs = JSON.parseObject(jsonObject.toJSONString(), ShProductSpecs.class);
        return shProductSpecsService.update(shProductSpecs);

    }

}